package cn.kgc.common.fenye;

import java.util.List;

/**
 * Created by Administrator on 2018/11/1.
 */
public class PageUtil<T> {
        //前端看
        private int beginPos;//总记录数
        private int curPage;//总页面数
        private int pageCount; //当前页
        private List<T> rows;//要显示的数据
        private final int  pagesize=6;
        private  int total;

    public PageUtil(int totalcount, int pagenum){
            this.total=totalcount;
            this.curPage=pagenum;
            this.pageCount=totalcount%pagesize==0?totalcount/pagesize:totalcount/pagesize+1;
            this.beginPos=(pagenum-1)*pagesize;
        }
        private T queryData;//查询条件

    public int getBeginPos() {
        return beginPos;
    }

    public void setBeginPos(int beginPos) {
        this.beginPos = beginPos;
    }

    public int getCurPage() {
        return curPage;
    }

    public void setCurPage(int curPage) {
        this.curPage = curPage;
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    public int getPagesize() {
        return pagesize;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public T getQueryData() {
        return queryData;
    }

    public void setQueryData(T queryData) {
        this.queryData = queryData;
    }
}
